<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/component/commonTagLib.jsp" %>

<!DOCTYPE html>
<html>
<head>
    <title><spring:message code="message.listForm.yiLiaoJiGou"/><spring:message code="message.listForm.zhuCeXinXi"/><spring:message code="message.jqGrid.cz.audit"/></title>
    <%@ include file="/WEB-INF/component/commonCSS.jsp" %>
    <link href="${ctx}/lib/plugins/daterangepicker/daterangepicker-bs3.css" rel="stylesheet" />
    <style type="text/css">
    	span.required {
    		color: red;
    		margin-right: 6px;
    	}
    	.text-left{
    	    color:#949494;
    	}
    	.box-body {
         margin-bottom: -20px;
        }
    </style>
</head>
<body class="skin-blue sidebar-mini fixed skin-blue-light-frame">
    <section class="content-header">
        <h1><spring:message code="message.listForm.yiLiaoJiGou"/><spring:message code="message.listForm.zhuCeXinXi"/><spring:message code="message.jqGrid.cz.audit"/></h1>
        <ol class="breadcrumb">
            <li><a href="${ctx}/home.jsp"><i class="fa fa-home"></i><spring:message code="message.lable.first"/></a></li>
            <li class="active"><a href="#"><spring:message code="message.listForm.zhuCeShenHe"/></a></li>
            <li class="active"><a href="#"><spring:message code="message.listForm.yiLiaoJiGou"/><spring:message code="message.listForm.zhuCeXinXi"/><spring:message code="message.jqGrid.cz.audit"/></a></li>
        </ol>
    </section>
    <section class="content">
        <div class=" box box-success ">
            <form id="form" class="form-horizontal" action="saveAuditHosp.html" method="post">
            	<input type="hidden" name="hospId" value="${hospInfo.hospId}" />  
            	<div class="box-header with-border">
                   <h3 class="box-title"><spring:message code="message.listForm.yiLiaoJiGouxinxi"/></h3>
                </div>          	
                <div class="box-body">                 
                    <div class="form-group form-group-xs">
                        <label for="hospCode" class="col-sm-2 text-right"><spring:message code="message.listForm.yiLiaoJiGouBianMa"/><spring:message code="message.yanZheng.maoHao"/></label>
                        <div class="col-sm-3 text-left">
                            <input class="form-control" id="hospCode" name="hospCode" value="<c:out value="${ hospInfo.hospCode }"></c:out>" placeholder="<spring:message code="message.listForm.yiLiaoJiGouBianMa"/>" type="hidden" maxlength="50"><c:out value="${ hospInfo.hospCode }"></c:out>
                        </div>
                        <label for="hospName" class="col-sm-3 text-right"><spring:message code="message.listForm.yiLiaoJiGouMingCheng"/><spring:message code="message.yanZheng.maoHao"/></label>
                        <div class="col-sm-3 text-left">
                            <input class="form-control" id="hospName" name="hospName" value="<c:out value="${ hospInfo.hospName }"></c:out>" placeholder="<spring:message code="message.listForm.yiLiaoJiGouMingCheng"/>" type="hidden" maxlength="100"><c:out value="${ hospInfo.hospName }"></c:out>
                        </div>
                    </div>
                    <div class="line"></div>
                    <div class="form-group form-group-xs">
                        <label for="hospShortName" class="col-sm-2 text-right"><spring:message code="message.listForm.yiLiaoJiGouJianCheng"/><spring:message code="message.yanZheng.maoHao"/></label>
                        <div class="col-sm-3 text-left">
                            <input class="form-control" id="hospShortName" name="hospShortName" value="<c:out value="${ hospInfo.hospShortName }"></c:out>" placeholder="<spring:message code="message.listForm.yiLiaoJiGouJianCheng"/>" type="hidden" maxlength="100"><c:out value="${ hospInfo.hospShortName }"></c:out>
                        </div>
                        <label for="orgCode" class="col-sm-3 text-right"><spring:message code="message.listForm.zuZhiJiGouDaiMa"/><spring:message code="message.yanZheng.maoHao"/></label>
                        <div class="col-sm-3 text-left">
                            <input class="form-control" id="orgCode" name="orgCode" value="<c:out value="${ hospInfo.orgCode }"></c:out>" placeholder="<spring:message code="message.listForm.zuZhiJiGouDaiMa"/>" type="hidden" maxlength="20"><c:out value="${ hospInfo.orgCode }"></c:out>
                        </div>
                    </div>
                    <div class="line"></div>
                    <div class="form-group form-group-xs">
                        <label for="hospClassify" class="col-sm-2 text-right"><spring:message code="message.listForm.yiLiaoJiGouFenLei"/><spring:message code="message.yanZheng.maoHao"/></label>
                        <div class="col-sm-3 text-left">
                        	<input class="form-control" type="hidden" id="hospClassify" name="hospClassify" value="${hospInfo.hospClassify }">
                        		<c:out value="${ hospInfo.hospClassifyName }"></c:out>
                        </div>
                        <label for="hospType" class="col-sm-3 text-right"><spring:message code="message.listForm.yiLiaoJiGouLeiXing"/><spring:message code="message.yanZheng.maoHao"/></label>
                        <div class="col-sm-3 text-left">
                        	<input id="hospType1" class="form-control" style="width:47%;display:inline-block;" type="hidden" value="<c:out value="${hospInfo.hosptype.fatherType.hospTypeId}"></c:out>"><c:out value="${hospInfo.hosptype.fatherType.hospType}"></c:out>
                            <input id="hospType2" name="hosptype.hospTypeId" class="form-control" style="width:47%;display:inline-block;" type="hidden" value="<c:out value="${hospInfo.hosptype.hospTypeId}"></c:out>"><c:out value="${hospInfo.hosptype.hospType}"></c:out>
                        </div>
                    </div>
                    <div class="line"></div>
                    <div class="form-group form-group-xs">
                        <label for="hospLevelId" class="col-sm-2 text-right"><spring:message code="message.listForm.yiLiaoJiGouDengJi"/><spring:message code="message.yanZheng.maoHao"/></label>
                        <div class="col-sm-3 text-left">
                        	<input class="form-control" type="hidden" id="hospLevelId" name="hospLevelId" value="${hospInfo.hospLevelId }">
                        		<c:out value="${ hospInfo.hospLevelName }"></c:out>
                        </div>
                        <label for="hospPhone" class="col-sm-3 text-right"><spring:message code="message.listForm.yiLiaoJiGouDianHua"/><spring:message code="message.yanZheng.maoHao"/></label>
                        <div class="col-sm-3 text-left">
                            <input class="form-control" id="hospPhone" name="hospPhone" value="<c:out value="${ hospInfo.hospPhone }"></c:out>" placeholder="<spring:message code="message.listForm.yiLiaoJiGouDianHua"/>" type="hidden" maxlength="20"><c:out value="${ hospInfo.hospPhone }"></c:out>
                        </div>
                    </div>
                    <div class="line"></div>
                    <div class="form-group form-group-xs">
                    <label for="area" class="col-sm-2 text-right"><spring:message code="message.listForm.zhuCe"/><spring:message code="message.listForm.diQu"/><spring:message code="message.yanZheng.maoHao"/></label>
                        <div class="col-sm-3 text-left">
                            <input id="area3" name="area.areaid" type="hidden" class="form-control" value="<c:out value="${hospInfo.area.areaid  }"></c:out>"  style="width:31%;display:inline-block;"><c:out value="${hospInfo.area.arfullname  }"></c:out>
                        </div>
                        </div>
                    
                    <div class="line"></div>
                    <div class="form-group form-group-xs">
                        <label for="bedNum" class="col-sm-2 text-right"><spring:message code="message.listForm.chuangWeiShu"/><spring:message code="message.yanZheng.maoHao"/></label>
                        <div class="col-sm-3 text-left">
                            <input class="form-control" id="bedNum" name="bedNum" value="<c:out value="${ hospInfo.bedNum }"></c:out>" placeholder="<spring:message code="message.listForm.chuangWeiShu"/>" type="hidden" maxlength="11"><c:out value="${ hospInfo.bedNum }"></c:out>
                        </div>
                        <label for="incomPatNum" class="col-sm-3 text-right"><spring:message code="message.listForm.nianMenZhengLiangDanWei"/><spring:message code="message.yanZheng.maoHao"/></label>
                        <div class="col-sm-3 text-left">
                            <input class="form-control" id="incomPatNum" name="incomPatNum" value="<c:out value="${ hospInfo.incomPatNum }"></c:out>" placeholder="<spring:message code="message.listForm.nianMenZhengLiang"/>" type="hidden" maxlength="20"><c:out value="${ hospInfo.incomPatNum }"></c:out>
                        </div>
                    </div>
                    <div class="line"></div>
                    <div class="form-group form-group-xs">
                        <label for="staffNum" class="col-sm-2 text-right"><spring:message code="message.listForm.yuanGongShu"/><spring:message code="message.yanZheng.maoHao"/></label>
                        <div class="col-sm-3 text-left">
                            <input class="form-control" id="staffNum" name="staffNum" value="<c:out value="${ hospInfo.staffNum }"></c:out>" placeholder="<spring:message code="message.listForm.yuanGongShu"/>" type="hidden" maxlength="11"><c:out value="${ hospInfo.staffNum }"></c:out>
                        </div>
                        <label for="regCap" class="col-sm-3 text-right"><spring:message code="message.listForm.zhuCheZiBenDanWei"/><spring:message code="message.yanZheng.maoHao"/></label>
                        <div class="col-sm-3 text-left">
                            <input class="form-control" id="regCap" name="regCap" value="<c:out value="${ hospInfo.regCap }"></c:out>" placeholder="<spring:message code="message.listForm.zhuCheZiBen"/>" type="hidden" maxlength="20"><c:out value="${ hospInfo.regCap }"></c:out>
                        </div>
                    </div>
                <div class="line"></div>        
                <div class="form-group form-group-xs">
                        <label for="hospLiceNo" class="col-sm-2 text-right"><spring:message code="message.listForm.zhiYeXuKeZhengHao"/><spring:message code="message.yanZheng.maoHao"/></label>
                        <div class="col-sm-3 text-left">
                            <input class="form-control" id="hospLiceNo" name="hospLiceNo" value="<c:out value="${ hospInfo.hospLiceNo }"></c:out>" placeholder="<spring:message code="message.listForm.yiLiaoJiGouZhiYeXuKeZhengHao"/>" type="hidden" maxlength="128"><c:out value="${ hospInfo.hospLiceNo }"></c:out>
                        </div>
                        <label for="hospLiceStartDate" class="col-sm-3 text-right"><spring:message code="message.listForm.ZhiYeXuKeZhengYouXiaoQi"/><spring:message code="message.yanZheng.maoHao"/></label>
                        <div class="col-sm-3 text-left">
                        <input class="form-control" type="hidden" readonly="readonly" id="hospLiceStartDate"  name="hospLiceStartDate"  value="<c:out value="${ hospInfo.hospLiceStartDateStr }"></c:out>" placeholder="<spring:message code="message.listForm.ZhiYeXuKeZhengStart"/>" 
                onFocus="var endDate=$dp.$('hospLiceEndDate');WdatePicker({maxDate:'#F{$dp.$D(\'hospLiceEndDate\')}'})" 
              /><c:out value="${ hospInfo.hospLiceStartDateStr }"></c:out> <spring:message code="message.listForm.zhi"/> <c:out value="${ hospInfo.hospLiceEndDateStr }"></c:out>
                        </div>
                        <div class="col-sm-3 text-left">
                         <input class="form-control" type="hidden" readonly="readonly" id="hospLiceEndDate"  name="hospLiceEndDate" value="${ hospInfo.hospLiceEndDateStr }" placeholder="<spring:message code="message.listForm.ZhiYeXuKeZhengEnd"/>"   
             onFocus="WdatePicker({minDate:'#F{$dp.$D(\'hospLiceStartDate\')}'})"                            
              />
                        </div>
                        </div>
                        <div class="line"></div>
                          <div class="form-group form-group-xs">
                        <label for="hospAddress" class="col-sm-2 text-right"><spring:message code="message.listForm.yiLiaoJiGou"/><spring:message code="message.listForm.diZhi"/><spring:message code="message.yanZheng.maoHao"/></label>
                        <div class="col-sm-9 text-left">
                            <input type="hidden" class="form-control" id="hospAddress" name="hospAddress"  placeholder="<spring:message code="message.listForm.yiLiaoJiGou"/><spring:message code="message.listForm.diZhi"/>" maxlength="512" value="<c:out value="${hospInfo.hospAddress  }"></c:out>"><c:out value="${hospInfo.hospAddress  }"></c:out>
                        </div>
                    </div>
                    <div class="line"></div>
                    <div class="form-group form-group-xs">
                        <label for="profile" class="col-sm-2 text-right"><spring:message code="message.listForm.yiLiaoJiGou"/><spring:message code="message.listForm.jianJie"/><spring:message code="message.yanZheng.maoHao"/></label>
                        <div class="col-sm-9 text-left">
                            <input class="form-control" id="profile" name="profile" value="<c:out value="${hospInfo.profile  }"></c:out>" placeholder="<spring:message code="message.listForm.jianJie"/>" maxlength="1000" type="hidden"><c:out value="${hospInfo.profile  }"></c:out>
                        </div>
                    </div>
                   </div>
                     <div class="box-header with-border">
                	<h3 class="box-title"><spring:message code="message.listForm.shiYeDanWei"/><spring:message code="message.listForm.faRenxinxi"/></h3>
                	</div> 
                	<div class="box-body"> 
                    <div class="form-group form-group-xs">
                        <label for="legalRepName" class="col-sm-2 text-right"><spring:message code="message.listForm.faRenXingMing"/><spring:message code="message.yanZheng.maoHao"/></label>
                        <div class="col-sm-3 text-left">
                            <input class="form-control" id="legalRepName" name="legalRepName" value="<c:out value="${ hospInfo.legalRepName }"></c:out>" placeholder="<spring:message code="message.listForm.faRenXingMing"/>" type="hidden" maxlength="10"><c:out value="${ hospInfo.legalRepName }"></c:out>
                        </div>
                        <label for="legalRepIdnum" class="col-sm-3 text-right"><spring:message code="message.listForm.faRenShengFenZheng"/><spring:message code="message.yanZheng.maoHao"/></label>
                        <div class="col-sm-3 text-left">
                            <input class="form-control" id="legalRepIdnum" name="legalRepIdnum" value="<c:out value="${ hospInfo.legalRepIdnum }"></c:out>" placeholder="<spring:message code="message.listForm.faRenShengFenZheng"/>" type="hidden" maxlength="20"><c:out value="${ hospInfo.legalRepIdnum }"></c:out>
                        </div>
                    </div>
                    <div class="line"></div>
                    <div class="form-group form-group-xs">
                        <label for="legalRepTelephone" class="col-sm-2 text-right"><spring:message code="message.listForm.faRenDianHua"/><spring:message code="message.yanZheng.maoHao"/></label>
                        <div class="col-sm-3 text-left">
                            <input class="form-control" id="legalRepTelephone" name="legalRepTelephone" value="<c:out value="${ hospInfo.legalRepTelephone }"></c:out>" placeholder="<spring:message code="message.listForm.faRenDianHua"/>" type="hidden" maxlength="15"><c:out value="${ hospInfo.legalRepTelephone }"></c:out>
                        </div>
                        <label for="legalRepHandphone" class="col-sm-3 text-right"><spring:message code="message.listForm.faRenShouJi"/><spring:message code="message.yanZheng.maoHao"/></label>
                        <div class="col-sm-3 text-left">
                            <input class="form-control" id="legalRepHandphone" name="legalRepHandphone" value="<c:out value="${ hospInfo.legalRepHandphone }"></c:out>" placeholder="<spring:message code="message.listForm.faRenShouJi"/>" type="hidden" maxlength="15"><c:out value="${ hospInfo.legalRepHandphone }"></c:out>
                        </div>
                    </div>
                    <div class="line"></div>
                    <div class="form-group form-group-xs">
                        <label for="enterLiceNo" class="col-sm-2 text-right"><spring:message code="message.listForm.zhengShuHao"/><spring:message code="message.yanZheng.maoHao"/></label>
                        <div class="col-sm-3 text-left">
                            <input class="form-control" id="enterLiceNo" name="enterLiceNo" value="<c:out value="${ hospInfo.enterLiceNo }"></c:out>" placeholder="<spring:message code="message.listForm.shiYeDanWeiFaRenZhengShuHao"/>" type="hidden" maxlength="128"><c:out value="${ hospInfo.enterLiceNo }"></c:out>
                        </div>
                        <label for="enterLiceStartDate" class="col-sm-3 text-right"><spring:message code="message.listForm.zhengShuYouXiaoQi"/><spring:message code="message.yanZheng.maoHao"/></label>
                        <div class="col-sm-3 text-left">
                         <input class="form-control" type="hidden" readonly="readonly" id="enterLiceStartDate"  name="enterLiceStartDate"  value="<c:out value="${hospInfo.enterLiceStartDateStr  }"></c:out>" placeholder="<spring:message code="message.listForm.shiYeDanWeiFaRenZhengShuStart"/>" 
                onFocus="var endDate=$dp.$('enterLiceEndDate');WdatePicker({maxDate:'#F{$dp.$D(\'enterLiceEndDate\')}'})" /><c:out value="${hospInfo.enterLiceStartDateStr  }"></c:out> <spring:message code="message.listForm.zhi"/> <c:out value="${hospInfo.enterLiceEndDateStr  }"></c:out>
                 <input class="form-control" type="hidden" readonly="readonly" id="enterLiceEndDate"  name="enterLiceEndDate" value="${ hospInfo.enterLiceEndDateStr }" placeholder="<spring:message code="message.listForm.shiYeDanWeiFaRenZhengShuEnd"/>"   
             onFocus="WdatePicker({minDate:'#F{$dp.$D(\'hospLiceStartDate\')}'})" />
                        </div>
                    </div>
              </div>      
                     
                <div class="box-header with-border">
                <h3 class="box-title"><spring:message code="message.listForm.liangXiRenxinxi"/></h3>
                </div>
                <div class="box-body">
                    <div class="form-group form-group-xs">
                        <label for="contactName" class="col-sm-2 text-right"><spring:message code="message.listForm.liangXiRenXingMing"/><spring:message code="message.yanZheng.maoHao"/></label>
                        <div class="col-sm-3 text-left">
                            <input class="form-control" id="contactName" name="contactName" value="<c:out value="${ hospInfo.contactName }"></c:out>" placeholder="<spring:message code="message.listForm.liangXiRenXingMing"/>" type="hidden" maxlength="10"><c:out value="${ hospInfo.contactName }"></c:out>
                        </div>
                        <label for="contactIdnum" class="col-sm-3 text-right"><spring:message code="message.listForm.liangXiRenShengFenZheng"/><spring:message code="message.yanZheng.maoHao"/></label>
                        <div class="col-sm-3 text-left">
                            <input class="form-control" id="contactIdnum" name="contactIdnum" value="<c:out value="${ hospInfo.contactIdnum }"></c:out>" placeholder="<spring:message code="message.listForm.liangXiRenShengFenZheng"/>" type="hidden" maxlength="20"><c:out value="${ hospInfo.contactIdnum }"></c:out>
                        </div>
                    </div>
                    <div class="line"></div>
                    <div class="form-group form-group-xs">
                        <label for="contactPos" class="col-sm-2 text-right"><spring:message code="message.listForm.liangXiRenZhiWu"/><spring:message code="message.yanZheng.maoHao"/></label>
                        <div class="col-sm-3 text-left">
                            <input class="form-control" id="contactPos" name="contactPos" value="<c:out value="${ hospInfo.contactIdnum }"></c:out>" placeholder="<spring:message code="message.listForm.liangXiRenZhiWu"/>" type="hidden" maxlength="32"><c:out value="${ hospInfo.contactIdnum }"></c:out>
                        </div>
                        <label for="contactTelephone" class="col-sm-3 text-right"><spring:message code="message.listForm.liangXiRenDianHua"/><spring:message code="message.yanZheng.maoHao"/></label>
                        <div class="col-sm-3 text-left">
                            <input class="form-control" id="contactTelephone" name="contactTelephone" value="<c:out value="${ hospInfo.contactTelephone }"></c:out>" placeholder="<spring:message code="message.listForm.liangXiRenDianHua"/>" type="hidden" maxlength="20"><c:out value="${ hospInfo.contactTelephone }"></c:out>
                        </div>
                    </div>
                    <div class="line"></div>
                    <div class="form-group form-group-xs">
                        <label for="contactHandphone" class="col-sm-2 text-right"><spring:message code="message.listForm.liangXiRenShouJi"/><spring:message code="message.yanZheng.maoHao"/></label>
                        <div class="col-sm-3 text-left">
                            <input class="form-control" id="contactHandphone" name="contactHandphone" value="<c:out value="${ hospInfo.contactHandphone }"></c:out>" placeholder="<spring:message code="message.listForm.liangXiRenShouJi"/>" type="hidden" maxlength="20"><c:out value="${ hospInfo.contactHandphone }"></c:out>
                        </div>
                        <label for="contactEmail" class="col-sm-3 text-right"><spring:message code="message.listForm.liangXiRenYouXiang"/><spring:message code="message.yanZheng.maoHao"/></label>
                        <div class="col-sm-3 text-left">
                            <input class="form-control" id="contactEmail" name="contactEmail" value="<c:out value="${ hospInfo.contactEmail }"></c:out>" placeholder="<spring:message code="message.listForm.liangXiRenYouXiang"/>" type="hidden" maxlength="20"><c:out value="${ hospInfo.contactEmail }"></c:out>
                        </div>
                    </div>
                    <div class="line"></div>
                    <div class="form-group form-group-xs">
                        <label for="contactQQ" class="col-sm-2 text-right"><spring:message code="message.listForm.liangXiRenQQ"/><spring:message code="message.yanZheng.maoHao"/></label>
                        <div class="col-sm-3 text-left">
                            <input class="form-control" id="contactQQ" name="contactQQ" value="<c:out value="${ hospInfo.contactQQ }"></c:out>" placeholder="<spring:message code="message.listForm.liangXiRenQQ"/>" type="hidden" maxlength="20"><c:out value="${ hospInfo.contactQQ }"></c:out>
                        </div>
                    </div>
                    
                    <div class="line"></div>
                    <div class="form-group form-group-xs">
                    <input type="hidden" class="form-control" id="auditStatus" name="auditStatus">
                        <label for="auditRemark" class="col-sm-2 control-label"><spring:message code="message.listForm.shenHeBeiZhu"/><spring:message code="message.yanZheng.maoHao"/></label>
                        <div class="col-sm-9">
                            <textarea class="form-control" id="auditRemark" name="auditRemark" rows="3" placeholder="<spring:message code="message.listForm.shenHeBeiZhu"/>" maxlength="500"></textarea>
                        </div>
                    </div>
                 </div>   
                <div class="box-footer text-center">
                    <button type="button" class="btn btn-primary btn-sm" onclick="saveAuditUser(1);"><spring:message code="message.listForm.tongGuoSpacing"/></button>
                    <button type="button" class="btn btn-primary btn-sm" onclick="saveAuditUser(2);"><spring:message code="message.listForm.buTongGuo"/></button>
                    <a href="${ctx }/auditUser/toAuditHospList.html" class="btn btn-danger btn-sm"><spring:message code="message.button.getBackSpacing"/></a>
                </div>
            </form>
        </div>
    </section>
    
    <%@ include file="/WEB-INF/component/commonJS.jsp" %>
    <script src="${ctx}/lib/plugins/daterangepicker/moment.js"></script>
    <script src="${ctx}/lib/plugins/daterangepicker/daterangepicker.js"></script>
    
    <script type="text/javascript">
    
    	//	保存角色信息
    	function saveAuditUser(status) {
    		$("#auditStatus").val(status);
    		/* if (!validate()) {
    			return;
    		} */
    		//	通过查询基础库是否存在
    		if ($("#auditStatus").val() == "1") {
    			$.post("checkHospExist.html", {
        			"hospCode" : $.trim($("#hospCode").val()),
        			"hospName" : $.trim($("#hospName").val())
        		}, function(result) {
        			if (result.success && result.rows) {
        				$.HN.message.confirm("<spring:message code="message.lable.hospinfoStd"/><spring:message code="message.listForm.zhong"/><spring:message code="message.listForm.alreadyShow"/><spring:message code="message.listForm.alreadyShow"/>", "", "").on(function(bool) {
        					if (bool) {
        						submitSave();
        					}
        				});
        			} else {
        				submitSave();
        			}
        		}, "json").error(function(err) {
        			top.window.document.location = "${ctx}/login.html"; 
        		});
    		} else {	//	不通过
    			submitSave();
    		}
    	}
    	
    	//	提交保存
    	function submitSave() {
   			$("#form").ajaxSubmit({
       			dataType : "json",
       			timeout: 10000,
       			success : function(result, statusText) {
       				if (result.success) {
       					
       						$.HN.message.alert("<spring:message code="message.HN.alert.baoCunCheng"/>", "", "success", function() {
           						document.location = "${ctx }/auditUser/toAuditHospList.html";
           					});
       				} else {
       					$.HN.message.alert(result.msg || "", "", "error");
       				}
       			}
       		});
    	}
    	
    	//	校验角色信息
    /* 	function validate() {
    		var hospCode = $.trim($("#hospCode").val());
    		if (hospCode == null || hospCode == "") {
    			$.HN.message.alert("请输入医疗机构编码！", "消息", "warn");
    			return false;
    		} else if (!/^[a-zA-Z0-9_]+$/.test(hospCode)) {
    			$.HN.message.alert("医疗机构编码只能由字母数字下划线组成！", "消息", "warn");
    			return false;
    		}else if (hospCode.length > 100 ) {
                $.HN.message.alert("医疗机构编码超过限制字数！请重新输入", "消息", "warn");
                return false;
            }
    		$("#hospCode").val(hospCode);

    		var hospName = $.trim($("#hospName").val());
    		if (hospName == null || hospName == "") {
    			$.HN.message.alert("请输入医疗机构名称！", "消息", "warn");
    			return false;
    		}else if (hospName.length > 512 ) {
                $.HN.message.alert("医疗机构名称超过限制字数！请重新输入", "消息", "warn");
                return false;
            }
    		$("#hospName").val(hospName);

    		var hospShortName = $.trim($("#hospShortName").val());
    		if (hospShortName == null || hospShortName == "") {
    			$.HN.message.alert("请输入医疗机构简称！", "消息", "warn");
    			return false;
    		}else if (hospShortName.length > 256 ) {
                $.HN.message.alert("医疗机构简称超过限制字数！请重新输入", "消息", "warn");
                return false;
            }
    		$("#hospShortName").val(hospShortName);

    		var orgCode = $.trim($("#orgCode").val());
    		if (orgCode == null || orgCode == "") {
    			$.HN.message.alert("请输入组织机构代码！", "消息", "warn");
    			return false;
    		} else if (!/^[a-zA-Z0-9_]+$/.test(orgCode)) {
    			$.HN.message.alert("组织机构代码只能由字母数字下划线组成！", "消息", "warn");
    			return;
    		}else if (orgCode.length > 20 ) {
                $.HN.message.alert("医疗机构代码超过限制字数！请重新输入", "消息", "warn");
                return false;
            }
    		$("#orgCode").val(orgCode);

    		var hospClassify = $.trim($("#hospClassify").val());
    		if (hospClassify == null || hospClassify == "") {
    			$.HN.message.alert("请选择医疗机构分类！", "消息", "warn");
    			return false;
    		}

    		var hospType = $.trim($("#hospType2").val());
    		if (hospType == null || hospType == "") {
    			$.HN.message.alert("请选择医疗机构类型！", "消息", "warn");
    			return false;
    		}

    		var hospLevelId = $.trim($("#hospLevelId").val());
    		if (hospLevelId == null || hospLevelId == "") {
    			$.HN.message.alert("请选择医疗机构等级！", "消息", "warn");
    			return false;
    		}

    		var hospPhone = $.trim($("#hospPhone").val());
    		if (hospPhone == null || hospPhone == "") {
    			$.HN.message.alert("请输入医疗机构电话！", "消息", "warn");
    			return false;
    		} else if (!/^(\d+[-]\d+)|(\d+)$/.test(hospPhone)) {
    			$.HN.message.alert("请输入正确的医疗机构电话！", "消息", "warn");
    			return false;
    		}else if (hospPhone.length > 20 ) {
                $.HN.message.alert("医疗机构电话超过限制字数！请重新输入", "消息", "warn");
                return false;
            }
    		$("#hospPhone").val(hospPhone);
    		
    		var hospAddress = $.trim($("#hospAddress").val());
    		if (hospAddress == null || hospAddress == "") {
    			$.HN.message.alert("请输入医疗机构地址！", "消息", "warn");
    			return false;
    		}else if (hospAddress.length > 1024 ) {
                $.HN.message.alert("医疗机构地址超过限制字数！请重新输入", "消息", "warn");
                return false;
            }
    		$("#hospAddress").val(hospAddress);
    		
    		var bedNum = $.trim($("#bedNum").val());
    		if (bedNum == null || bedNum == "") {
    			$.HN.message.alert("请输入床位数！", "消息", "warn");
    			return false;
    		} else if (!/^\d+$/.test(bedNum)) {
    			$.HN.message.alert("你输入的床位数不是一个正整数！", "消息", "warn");
    			return false;
    		}else if (bedNum.length > 11 ) {
                $.HN.message.alert("床位数超过限制字数！请重新输入", "消息", "warn");
                return false;
            }
    		$("#bedNum").val(bedNum);

    		var incomPatNum = $.trim($("#incomPatNum").val());
    		if (incomPatNum == null || incomPatNum == "") {
    			$.HN.message.alert("请输入年门诊量！", "消息", "warn");
    			return false;
    		} else if (!/^[0-9]+(.[0-9]{2})+$/.test(incomPatNum)) {
    			$.HN.message.alert("年门诊量应大于0的数！", "消息", "warn");
    			return false;
    		}
    		$("#incomPatNum").val(incomPatNum);
    		
    		var staffNum = $.trim($("#staffNum").val());
    		if (staffNum == null || staffNum == "") {
    			$.HN.message.alert("请输入员工数！", "消息", "warn");
    			return false;
    		} else if (!/^\d+$/.test(staffNum)) {
    			$.HN.message.alert("你输入的员工数不是一个正整数！", "消息", "warn");
    			return false;
    		}else if (staffNum.length > 11 ) {
                $.HN.message.alert("员工数超过限制字数！请重新输入", "消息", "warn");
                return false;
            }
    		$("#staffNum").val(staffNum);

    		var regCap = $.trim($("#regCap").val());
    		if (regCap == null || regCap == "") {
    			$.HN.message.alert("请输入注册资本！", "消息", "warn");
    			return false;
    		} else if (isNaN(regCap)) {
    			$.HN.message.alert("你输入的注册资本不是一个数！", "消息", "warn");
    			return false;
    		}else if (regCap.length > 20 ) {
                $.HN.message.alert("注册资本超过限制字数！请重新输入", "消息", "warn");
                return false;
            }
    		var index = regCap.lastIndexOf(".");
    		if (index > 0 && regCap.substr(index).length > 3) {
    			$.HN.message.alert("注册资本最多保留两位小数！", "消息", "warn");
    			return false;
    		}
    		$("#regCap").val(regCap);

    		var legalRepName = $.trim($("#legalRepName").val());
    		if (legalRepName == null || legalRepName == "") {
    			$.HN.message.alert("请输入法人姓名！", "消息", "warn");
    			return false;
    		}else if (legalRepName.length > 20 ) {
                $.HN.message.alert("法人姓名超过限制字数！请重新输入", "消息", "warn");
                return false;
            }
    		$("#legalRepName").val(legalRepName);

    		var legalRepIdnum = $.trim($("#legalRepIdnum").val());
    		if (legalRepIdnum == null || legalRepIdnum == "") {
    			$.HN.message.alert("请输入法人身份证号！", "消息", "warn");
    			return false;
    		} else if (!/^\d+[a-zA-Z0-9]$/.test(legalRepIdnum)) {
    			$.HN.message.alert("请输入正确的身份证格式！", "消息", "warn");
    			return false;
    		}else if (legalRepIdnum.length > 20 ) {
                $.HN.message.alert("法人身份证号超过限制字数！请重新输入", "消息", "warn");
                return false;
            }
    		$("#legalRepIdnum").val(legalRepIdnum);

    		var legalRepTelephone = $.trim($("#legalRepTelephone").val());
    		if (legalRepTelephone == null || legalRepTelephone == "") {
    			$.HN.message.alert("请输入法人电话！", "消息", "warn");
    			return false;
    		} else if (!/^(\d+[-]\d+)|(\d+)$/.test(legalRepTelephone)) {
    			$.HN.message.alert("请输入正确的法人电话！", "消息", "warn");
    			return false;
    		}else if (legalRepTelephone.length > 20 ) {
                $.HN.message.alert("法人电话超过限制字数！请重新输入", "消息", "warn");
                return false;
            }
    		$("#legalRepTelephone").val(legalRepTelephone);

    		var legalRepHandphone = $.trim($("#legalRepHandphone").val());
    		if (legalRepHandphone == null || legalRepHandphone == "") {
    			$.HN.message.alert("请输入法人手机号！", "消息", "warn");
    			return false;
    		} else if (!/^(\d+[-]\d+)|(\d+)$/.test(legalRepHandphone)) {
    			$.HN.message.alert("请输入正确的法人手机号！", "消息", "warn");
    			return false;
    		}else if (legalRepHandphone.length > 20 ) {
                $.HN.message.alert("法人手机超过限制字数！请重新输入", "消息", "warn");
                return false;
            }
    		$("#legalRepHandphone").val(legalRepHandphone);

    		var contactName = $.trim($("#contactName").val());
    		if (contactName == null || contactName == "") {
    			$.HN.message.alert("请输入联系人姓名！", "消息", "warn");
    			return false;
    		}else if (contactName.length > 20 ) {
                $.HN.message.alert("联系人姓名超过限制字数！请重新输入", "消息", "warn");
                return false;
            }
    		$("#contactName").val(contactName);

    		var contactIdnum = $.trim($("#contactIdnum").val());
    		if (contactIdnum == null || contactIdnum == "") {
    			$.HN.message.alert("请输入联系人身份证号！", "消息", "warn");
    			return false;
    		} else if (!/^\d+[a-zA-Z0-9]$/.test(contactIdnum)) {
    			$.HN.message.alert("联系人身份证号只能由字母数字下划线组成且必须以数字开头！", "消息", "warn");
    			return false;
    		}else if (contactIdnum.length > 20 ) {
                $.HN.message.alert("联系人身份证号超过限制字数！请重新输入", "消息", "warn");
                return false;
            }
    		$("#contactIdnum").val(contactIdnum);

    		var contactPos = $.trim($("#contactPos").val());
    		if (contactPos == null || contactPos == "") {
    			$.HN.message.alert("请输入联系人职务！", "消息", "warn");
    			return false;
    		}else if (contactPos.length > 20 ) {
                $.HN.message.alert("联系人职务超过限制字数！请重新输入", "消息", "warn");
                return false;
            }
    		$("#contactPos").val(contactPos);

    		var contactTelephone = $.trim($("#contactTelephone").val());
    		if (contactTelephone == null || contactTelephone == "") {
    			$.HN.message.alert("请输入联系人电话！", "消息", "warn");
    			return false;
    		} else if (!/^(\d+[-]\d+)|(\d+)$/.test(contactTelephone)) {
    			$.HN.message.alert("请输入正确的联系人电话！", "消息", "warn");
    			return false;
    		}else if (contactTelephone.length > 20 ) {
                $.HN.message.alert("联系人电话超过限制字数！请重新输入", "消息", "warn");
                return false;
            }
    		$("#contactTelephone").val(contactTelephone);

    		var contactHandphone = $.trim($("#contactHandphone").val());
    		if (contactHandphone == null || contactHandphone == "") {
    			$.HN.message.alert("请输入联系人手机号！", "消息", "warn");
    			return false;
    		} else if (!/^(\d+[-]\d+)|(\d+)$/.test(contactHandphone)) {
    			$.HN.message.alert("请输入正确的联系人手机号！", "消息", "warn");
    			return false;
    		}else if (contactHandphone.length > 20 ) {
                $.HN.message.alert("联系人手机号超过限制字数！请重新输入", "消息", "warn");
                return false;
            }
    		$("#contactHandphone").val(contactHandphone);

    		var contactEmail = $.trim($("#contactEmail").val());
    		if (contactEmail == null || contactEmail == "") {
    			$.HN.message.alert("请输入联系人邮箱！", "消息", "warn");
    			return false;
    		} else if (!/^[a-z0-9]+([._\\-]*[a-z0-9])*@([a-z0-9]+[-a-z0-9]*[a-z0-9]+.){1,63}[a-z0-9]+$/.test(contactEmail)) {
    			$.HN.message.alert("电子邮箱格式不正确！", "消息", "warn");
    			return false;
    		}else if (contactEmail.length > 20 ) {
                $.HN.message.alert("联系人邮箱超过限制字数！请重新输入", "消息", "warn");
                return false;
            }
    		$("#contactEmail").val(contactEmail);

    		var hospLiceNo = $.trim($("#hospLiceNo").val());
    		if (hospLiceNo == null || hospLiceNo == "") {
    			$.HN.message.alert("请输入医疗机构执业许可证号！", "消息", "warn");
    			return false;
    		} else if (!/^[a-zA-Z0-9_]+$/.test(hospLiceNo)) {
    			$.HN.message.alert("医疗机构执业许可证号只能由字母数字下划线组成！", "消息", "warn");
    			return false;
    		}else if (hospLiceNo.length > 128 ) {
                $.HN.message.alert("医疗机构执业许可证号超过限制字数！请重新输入", "消息", "warn");
                return false;
            }
    		$("#hospLiceNo").val(hospLiceNo);

    		var hospLiceStartDate = $.trim($("#hospLiceStartDate").val());
    		if (hospLiceStartDate == null || hospLiceStartDate == "") {
    			$.HN.message.alert("请选择执业许可证号有效期开始时间！", "消息", "warn");
    			return false;
    		}

    		var hospLiceEndDate = $.trim($("#hospLiceEndDate").val());
    		if (hospLiceEndDate == null || hospLiceEndDate == "") {
    			$.HN.message.alert("请选择执业许可证号有效期结束时间！", "消息", "warn");
    			return false;
    		}

    		var enterLiceNo = $.trim($("#enterLiceNo").val());
    		if (enterLiceNo == null || enterLiceNo == "") {
    			$.HN.message.alert("请输入事业单位法人证书号！", "消息", "warn");
    			return false;
    		} else if (!/^[a-zA-Z0-9_]+$/.test(enterLiceNo)) {
    			$.HN.message.alert("事业单位法人证书号只能由字母数字下划线组成！", "消息", "warn");
    			return false;
    		}else if (enterLiceNo.length > 128 ) {
                $.HN.message.alert("事业单位法人证书号超过限制字数！请重新输入", "消息", "warn");
                return false;
            }
    		$("#enterLiceNo").val(enterLiceNo);

    		var area3 = $.trim($("#area3").val());
    		if (area3 == null || area3 == "") {
    			$.HN.message.alert("请选择地区！", "消息", "warn");
    			return false;
    		}

    		var enterLiceStartDate = $.trim($("#enterLiceStartDate").val());
    		if (enterLiceStartDate == null || enterLiceStartDate == "") {
    			$.HN.message.alert("请选择事业单位法人证书有效期开始时间！", "消息", "warn");
    			return false;
    		}

    		var enterLiceEndDate = $.trim($("#enterLiceEndDate").val());
    		if (enterLiceEndDate == null || enterLiceEndDate == "") {
    			$.HN.message.alert("请选择事业单位法人证书有效期结束时间！", "消息", "warn");
    			return false;
    		}
    		
    		var auditStatus = $.trim($("#auditStatus").val());
    		if (auditStatus == null || auditStatus == "") {
    			$.HN.message.alert("请选择审核状态！", "消息", "warn");
    			return false;
    		}
    		
    		return true;
    	} */
    
    	 $(document).ready(function() {
    		
    		/* $("#area1").HNSelect({
                url: "${ctx}/selectController/getArea.html", 
                data: { ID: '000000' }, 
                defaultText: "<option value=''>请选择</option>",
                defaultselect: "${ hospInfo.area.father.father.areaid  }",
                func: function () {
                    $("#area2").HNSelect({
                        parent_selector: "#area1", 
                        url: "${ctx}/selectController/getArea.html", 
                        dataid: "ID", 
                        defaultText: "<option value=''>请选择</option>",
                        defaultselect: "${ hospInfo.area.father.areaid  }",
                        func: function () {
                            $("#area3").HNSelect({
                                parent_selector: "#area2", 
                                url: "${ctx}/selectController/getArea.html", 
                                dataid: "ID", 
                                defaultText: "<option value=''>请选择</option>",
                                defaultselect: "${ hospInfo.area.areaid  }"
                            });
                        }
                    });
                }
            }); 
    		
    		$("#hospType1").HNSelect({
                url: "${ctx}/selectController/getHospType.html", 
                data: { ID: '' }, 
                defaultText: "<option value=''>请选择</option>",
                defaultselect: "${hospInfo.hosptype.fatherType.hospTypeId}",
                func: function () {
                    $("#hospType2").HNSelect({
                        parent_selector: "#hospType1", 
                        url: "${ctx}/selectController/getHospType.html", 
                        dataid: "ID", 
                        defaultText: "<option value=''>请选择</option>",
                        defaultselect: "${hospInfo.hosptype.hospTypeId}"
                    });
                }
            });  */
    		
    		$("#hospLiceStartDate,#hospLiceEndDate,#enterLiceStartDate,#enterLiceEndDate").daterangepicker({
                timePicker: true,
                format: 'YYYY-MM-DD HH:mm:ss',
                timePickerIncrement: 1,
                timePicker12Hour: false,
                timePickerSeconds: true,
                singleDatePicker: true
            });
    		
    	});
    </script>
    
</body>
</html>
